
/**
 * 树扁平化为数组
 * @param lst 
 * @returns 
 */
export function treeToList(lst: any[]): any[] {
  return lst.reduce((res, item) => {
    const children = item['children'] || [];
    return res.concat(item, children.length ? treeToList(children) : [])
  }, [])
}